//vue.config.js
const TransformPages = require('uni-read-pages')
const {
	webpack
} = new TransformPages()


const path = require('path');
const IP = "https://gfzc-sit.syswinsoft.com/"
// const IP = "https://szzc-sit.test.cgbchina.com.cn:7571/"
// const IP = "http://console.wuyetoon.com:9002/"
// http://172.31.118.109:55433
module.exports = {
	configureWebpack: {
		plugins: [
			new webpack.DefinePlugin({
				ROUTES: webpack.DefinePlugin.runtimeValue(() => {
					const tfPages = new TransformPages({
						includes: ['path', 'name', 'aliasPath', 'meta']
					});
					return JSON.stringify(tfPages.routes)
				}, true)
			})

		],
	},
	devServer: {
		port: 8080,
		proxy: {
			'/usermanager': {
				target: IP,
				changeOrigin: true,
				pathRewrite: {
					'^/usermanager': ''
				}
			},
			'/apiweb': {
				target: IP,
				changeOrigin: true,
				pathRewrite: {
					'^/apiweb': ''
				}
			},
			'/customerweb': {
				target: IP,
				changeOrigin: true,
				pathRewrite: {
					'^/customerweb': ''
				}
			},
			'/open': {
				target: IP,
				changeOrigin: true,
				pathRewrite: {
					'^/open': ''
				}
			},
			'/rentownerh5': {
				target: IP,
				changeOrigin: true,
				pathRewrite: {
					'^/rentownerh5': ''
				}
			},
			'/basedata': {
				target: IP,
				changeOrigin: true,
				pathRewrite: {
					'^/basedata': ''
				}
			},
			'/message': {
				target: IP,
				changeOrigin: true,
				pathRewrite: {
					'^/message': ''
				}
			}
		},
	}
}
